<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="${BaseContext }">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Assess-Schedule JSP</title>
<!-- 引入css -->
<link rel="stylesheet" href="assets/css/amazeui.min.css">
<link rel="stylesheet" href="assets/css/app.css">
<link rel="stylesheet" href="assets/css/demo.css">
<link rel="stylesheet" href="static/css/bootstrap.min.css">
<link rel="stylesheet" href="static/css/font-awesome.min.css">
<link rel="stylesheet" href="assets/css/less/style.css">
<!-- 引入JQuery  js-->
<script src="static/js/jquery-3.2.1.min.js"></script>
<script src="assets/js/amazeui.min.js"></script>
<script src="static/js/bootstrap.min.js"></script>
<script src="assets/js/lib/lib.js"></script>
</head>
<body>

	<!-- 顶栏  -->
	<jsp:include page="include/top.jsp"></jsp:include>

	<div class="am-g">
		<div class="am-u-sm-2">
			<!-- menu -->
			<jsp:include page="include/menu.jsp"></jsp:include>
		</div>
		<div class="am-u-sm-10">
			<!-- 个人信息面板-->
			<div class="am-panel am-panel-default">
			  	<div class="am-panel-hd">评估进度</div>
			  	<div class="am-panel-bd">
					<c:if test="${empty pageInfo.list }">
						<table width="100%" height="100%" border="0" align="center"
							cellpadding="0" cellspacing="0">
							<tbody>
								<tr>
									<td align="center" class="noborder"><font
										style="font-size: 15px; color: red">没有相关数据！</font></td>
								</tr>
							</tbody>
						</table>
					</c:if>
					<c:if test="${not empty pageInfo.list }">
						<div class="am-container">
							<div class="am-g">
								<h4>教师信息</h4>
							</div>
							<c:forEach items="${pageInfo.list}" var="teacher">
							  	<div class="am-g">
								    <div class="am-u-sm-3">
										编号 ：<span id="row-tid">${teacher.tId }</span>
									</div>
								    <div class="am-u-sm-3">
								    	姓名 ： <span id="row-tname">${teacher.tName }</span>
								    </div>
									<div class="am-u-sm-3">
										联系方式 ： <span id="row-tgrade">${teacher.tPhone }</span>
									</div>
									<div class="am-u-sm-3">
										<button class="btn btn-default btn-xs btn-info" tid="${teacher.tId }" onclick="checkSchedule(this)">评估进度</button>
									</div>
								</div>
								
								<hr>
								
							</c:forEach>
						<!-- 页码 -->
						<jsp:include page="include/pageInfo.jsp"></jsp:include>
						</div>
						
					</c:if>
						
						<hr>
						
						<div class="am-container" id="schedule-div" style="display: none">
							<div class="am-g">
								<h4>评估进度</h4>
							</div>
						  	<div class="am-g">
						    	<!-- 进度条 -->
								<div class="main">
									<ul class="nav nav-pills nav-justified step step-progress"
										data-step="4">
										<li><a>分配成功<span class="caret"></span></a></li>
										<li><a>专家评分<span class="caret"></span></a></li>
										<li><a>专家总结<span class="caret"></span></a></li>
										<li><a>专家确认<span class="caret"></span></a></li>
										<li><a>系统确认<span class="caret"></span></a></li>
									</ul>
								</div>
							</div>
						</div>
					
				</div>
			</div>
		</div>
	</div>

	<!-- footer -->
	<jsp:include page="include/footer.jsp"></jsp:include>

	<script type="text/javascript">
		function checkSchedule(obj){
			var tId = $(obj).attr('tid');
			$.post('professor/getScheduleByTid.do',{tId:tId},function(data){
				var tmId = data.plan.tmId;
				var tsId = data.plan.tsId;
				var psId = data.plan.psId;
				var pcId = data.plan.pcId;
				var assessStatus = data.plan.assessStatus;
				//alert(tmId+'sss'+tsId+' bbb '+psId+' fff '+pcId+' ggg '+assessStatus);
				/* 加载进度条 */
				if(assessStatus==1){
					//评估完成
					/* $step.toStep(4); */
					bsStep(5);
				}else if(tmId==null && tsId==null && psId==null && pcId==null){
					//已分配，等待专家确认
					bsStep(1);	
				}else if(tmId!=null && tsId==null && psId==null && pcId==null){
					//专家正在审查
					bsStep(2);
				}else if(tmId!=null && tsId!=null && psId==null && pcId==null){
					//专家未评分，评估状态为等待专家审查评分
					bsStep(2);
				}else if(tmId!=null && tsId!=null && psId!=null && pcId==null){
					//专家总结，评分完成，等待总结
					bsStep(3);
				}else if(tmId!=null && tsId!=null && psId!=null && pcId!=null){
					//评估完成，等待专家确认
					bsStep(4);
				}
				$('#schedule-div').css('display','block');
			},'json');
		}
	</script>
</body>

</html>
